Welcome

Welcome.gif, 2464 bytes
1998 - 2006 © Carthago Software

Introduction

Twistpad is a not only a strong notepad replacer, but also a excellent editor primary targeting web and software developers

Main Features

  • Compatible with Windows 95/98/NT/2000/XP (Windows 95 and NT require Internet Explorer 4 Installed)
  • Unlimited file size and document windows (depends on Hardware)
  • Easy to edit custom syntax highlighting for computer languages and scripts
  • Copy/Export as RTF and HTML
  • Unlimited undo and redo
  • Built-in difference tool for comparing two files
  • Bookmarks
  • Fast opened document switch (like the Windows Taskbar)
  • Search in files
  • Configurable Toolbar
  • Print Preview
  • No shared DLLs, ActiveX controls or other system files are installed
  • and many more features...

Getting Help

To browse help, start by selecting an item on the left tree

© 1998 - 2006 Carthago Software. All rights reserved.


Registration

Twistpad is distributed as Shareware. You can freely download and try it for 30 days.
If you find it useful and decide to keep it over 30-day evaluation period, you should pay the registration fee.

The registration of Twistpad costs $19.95 per user.

Orders

Please visit the Carthago Software Web site for latest information
on registering Twistpad

Why Register?

  • Free technical support by e-mail and Carthago Web Site Forum
  • Free upgrades on service releases and minor versions
  • Discounts on major new versions
  • Encourage the authors to improve Twistpad
  • Removes 30 day limit
  • Removes startup dialog
  • Help support low cost software industry


Feedback and Support

Twistpad on the web

Latest versions and information can be found at the Carthago Software Web site.
There you can join our forums for support and questions you may have on Twistpad.


License Agreement

SOFTWARE LICENSE AGREEMENT

1.NOTICE TO USER:
THIS IS A CONTRACT. BY INSTALLING THIS SOFTWARE YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. This Carthago Software ("CARTHAGO") End User License Agreement (EULA) accompanies all Non-Freeware CARTHAGO products and related explanatory materials ("SOFTWARE"). The term "SOFTWARE" shall also include any upgrades, modified versions or updates of the Software licensed to you by CARTHAGO. Please read this License Agreement carefully. If you are reading this prior to electronic distribution, you will be asked to accept this agreement and continue to install or, if you wish to decline this agreement, in which case you will not be able to use the Software.

The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is licensed, not sold.

2.GRANT OF LICENSE
The software is licensed on a per-user basis, Upon issuance of a valid SERIAL NUMBER by CARTHAGO to you, this License Agreement grants you the following rights:

a. SOFTWARE PRODUCT : CARTHAGO grants to you as an individual, a non-transferable, nonexclusive license to use the SOFTWARE PRODUCT as follows:

IF YOU PURCHASED A SITE LICENSE - Usage is restricted to a company or/and a corporation or/and an enterprise or/and an organization. Unlimited number of computers of/within this site including both desktops and notebooks are allowed to install the SOFTWARE PRODUCT.

IF YOU PURCHASED A SINGLE USER LICENSE - One registered copy of this software may either be used by a single person who uses the software personally on one or two computers, or installed on a single workstation used non simultaneously by multiple people, but not both. Registered users are prohibited to reveal their unlock keys to other persons and/or companies.

b. All above licenses include unlimited software support for the current major version.

EVALUATION VERSION - You are allowed to use this software for 30 days for evaluation purposes without any charge. If you find the software useful and want continue using it, you must register it. Otherwise, you must delete (uninstall) this program from your computer. To register your copy of software, see program's help.

3. SUPPORT SERVICES
CARTHAGO may provide you with support services related to the SOFTWARE PRODUCT ("Support Services"). The provision and use of Support Services is governed by the CARTHAGO policies and programs described in the SOFTWARE PRODUCT user manual and/or in "online" documentation. Any supplemental software code provided to you as part of the Support Services shall considered part of the SOFTWARE PRODUCT and subject to the terms and conditions of this EULA.

4. COPYRIGHT:
The SOFTWARE is owned by CARTHAGO and its suppliers, and its structure, organization and code are the valuable trade secrets of Cartgago and its suppliers. The SOFTWARE is protected by United States Copyright Law and International Treaty provisions, this License Agreement does not grant you any intellectual property rights in the Software.

5. RESTRICTIONS:
General Limitations - You may not resell, transfer, rent or lease the SOFTWARE. You agree not to modify, adapt, translate, reverse engineer, decompile, disassemble or otherwise attempt to discover the source code of the Software. You may not alter or modify in any way the installer for the Software, or create a new installer for the Software. Any such unauthorized use shall result in immediate and automatic termination of this license and may result in criminal and/or civil prosecution.

Termination - Without prejudice to any other rights, CARTHAGO may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.

6. NO WARRANTY:
The SOFTWARE is being delivered to you AS IS and CARTHAGO makes no warranty as to its use or performance. CARTHAGO AND ITS SUPPLIERS DO NOT AND CANNOT WARRANT THE PERFORMANCE OR RESULTS YOU MAY OBTAIN BY USING THE SOFTWARE OR DOCUMENTATION. CARTHAGO AND ITS SUPPLIERS MAKE NO WARRANTIES, EXPRESS OR IMPLIED, AS TO NONINFRINGEMENT OF THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL CARTHAGO OR ITS SUPPLIERS BE LIABLE TO YOU FOR ANY CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS OR LOST SAVINGS, EVEN IF AN CARTHAGO REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY. Some states or jurisdictions do not allow the exclusion or limitation of incidental, consequential or special damages, or the exclusion of implied warranties or limitations on how long an implied warranty may last, so the above limitations may not apply to you.

7. If in doubt, contact Carthago Software directly via it's web site at http://www.carthagosoft.net


Acknowledgments

The Twistpad team, would like to thank the following people who helped in the development of Twistpad
  • Raymond Courteau
  • Joel Paula
  • Alex A. Denisov
  • Andrey V. Sorokin
  • Zhouyibo


Twistpad online help

Creating a new file

To create a new file in Twistpad, click the New button on the toolbar. A new window will created in memory. To locally save you will have to save, using the Save Command.

If you use the New command on the file menu, a dialog will offer you the option to open a syntax ready document, or let you choose from the template list.


Opening files

To open an existing file, click the Open toolbar button or select File > Open.

Browse for the file you want in the open file dialog and press open.


Search Results Window

Twistpad uses the MDI (multiple document interface) concept.
This allows several documents to be opened at the same time which can be switched to easily with the switch bar:

Basically MDI allows each document to be a edit window inside the Twistpad window.
You can work with the document windows in the Window menu, allowing cascading, minimize and even close all.


Compare Files Dialog

The Compare Files dialog allows the selection of the two files to be compared.

for in depth look at compare files, please refer to the Files Compare topic


Window Organizer Dialog

Window Organizer allow to select and close currently opened windows through a list.
Multi-select is allowed (use the mouse or CTRL to select multiple items.


Properties Dialog

The Properties dialog shows properties about the file and statistics about the document.
The Read Only attribute of the file can be set, as well as the EOL mode.


Open With Dialog

You can open a document in one or more editors by selecting Open With on the Tools menu.

Use the list presented with the editors available, or choose Add to include a new editor in the list.
After selecting a editor, press Open and the active document will then open in the selected editor.


Find In Files Dialog

Find in Files allows searches in multiple files for a matching word.

Search Options
  • Match Whole Word - if checked, only text that is a word is searched.
  • Match Case - if checked, the search will take the words case into consideration, in this case CAse is not the same as case.
  • Regular Expression - if checked, the search will use regular expressions.
More Options
  • Look In - Allows the selection of target dir where are the files to be searched. Use the browse button to look for a folder
  • Include Subfolders - If checked the search will include all folders under the main folder.
  • Search Opened Files - If checked no target dir is required, instead the search will be made on the currently opened files in Twistpad .
  • Search In Current Project - If checked, again no target dir is required, instead the search will be made on the files of the selected project.
In Files
Allows to choose the wild card in which the search is based.
eg:
  • *.html - Only files with the extension HTML will be searched
  • p*.* - Only files which start with a P will be searched
  • *.html;*.css - Only files with extensions html and css will be searched

the results of the search will be available in the Search Results Window


Customizing Twistpad

The Toolbar, the Editor Context Menu and Keyboard shortcuts can be customizable for your needs.
Clicking Tools > Customize... a customization dialog will appear with three distinct areas.

Both Toolbar and the Editor Menu are similar, a list represents the current selected items, press add to add any new command available in Twistpad, remove, to remove the selected command, add a separator and move the selected item up or down

The Keyboard tab allows Keyboard shortcuts for each command to be customized.


Find Dialog

Find/Replace Dialog

You can search for a word or specific text in the active document by selecting find in the search menu, or the click the find toolbar button.

Additionally pressing the replace button will present the replace dialog, which works in the same manner as the find dialog but allows the found word to be replaced by the one specified in the Replace With text box

Direction
Choose the direction to perform the search.

Options
  • Match Whole Word - if checked, only text that is a word is searched.
  • Match Case - if checked, the search will take the words case into consideration, in this case CAse is not the same as case.
  • Regular Expression - if checked, the search will use regular expressions.
Mark All
Bookmarks all lines in the active document which satisfies the search.


Calculate Expression Dialog

Calculate Expression allow a numeric expression to be calculated.
Simply select a block of text like, for instance, 10+20 and press
Calculate Expression in the menu or the editor context menu


Goto Dialog

The Goto dialog allows a quick move to a line, column or bookmark.
If extended selection is on, it means that the current cursor position, to the new selected position will be selected.


Sort Dialog

The Sort Dialog allows text in the active document to be sorted.

Sorting Order Specifies the sorting direction:
  • Ascending - ABCDE...
  • Descendig - ZYXW...

Text Specifies which text is sorted:
  • All Text - All text in the active document will be sorted.
  • Selected Text - Only the selected text in the active document will be sorted.
  • From Cursor - All text from the cursor position onwards will be sorted.

Sort on Specifies on which part of the line text is sorted
  • Beginning of Line - All the line is used for sorting.
  • Part Of Line - specifies where, in the line, to start the sort criteria in character count.
  • Field - Treats lines as records, and fields will be recognized with the delimiter
    eg: 12;32;43;53;34
    delimiter is ";" field #2 value is 32

Options
  • Treat Fields as Numeric - When specifying Fields as a sort method this options forces the fields to be treated as numeric.
  • Ignore Leading Blanks - Leading blanks in a line will not be taken used to sort.
  • Ignore Case - Ignores the case when comparing sorting.


List Bookmarks/Functions/Sections Dialog

List Functions/Sections Dialog

The Functions/Sections Dialog allows sections to be quickly identified in the active document.

This sections or functions are defined in the syntax definition of the opened file.
For more information on definition of sections, refer to the syntax definition files topic

Text can be typed in the text box in order to further filter the results.
double click or click Jump To to go to the selected line.


Bookmarks

Bookmarks allow a line in the editor to be book-marked. So it can be easily returned to at a later time

to set a bookmark, move to the desired line and press CTRL-F2 or use the toolbar or the menu (Pressing it again removes the bookmark)

Use F2 and SHIFT-F2 to goto next or previous bookmark.

To clear all set bookmarks press CTRL-SHIFT-F2 or use the toolbar or the menu.

To List all bookmarks currently set on the active document, press F9, More details here

Please keep in mind that all keyboard shortcuts can be modified in Preferences Dialog.


Spell Checker

The spell checker helps you verify the spelling of the text of the current document.
When Pressing the Spelling button or Spelling... from the Tools menu, a dialog will pop-up and ask prompt suggestions on misspelled words:

Easier to use, and more powerful is the Active Spelling feature of Twistpad.
when enabled (Tools > Active Spelling) instead of a pop up dialog, the misspelled words will be underlined by a wavy red line:

To correct the misspelled word, click with the right mouse button, and a menu with suggestions will popup, choose one from the list to correct the word, or click anywhere on the text to close the menu.

One of the most interesting features of spelling on Twistpad is that you can customize where the speller should be active. for instance if you have an HTML file you surely do not want the spell checker to constantly prompt for errors on words inside tags! This can be archived with Twistpad's syntax definition files


Working with layout windows

There are two types of windows in Twistpad; Layout windows, and document windows.

Layout windows can be docked to the main window, or float above it. This is archived simply by dragging the window to the desired window via it's caption.

When docked to the main window, Layout windows can be joined together via tabs, side by side or hidden.

Simply try dragging the windows and find a position which best suits your work.

All Layout windows can be toggled on or off in the menu View.


Clipboard Window

Twistpad Clipboard Window will collect items as you copy and cut.
Each item will then be available to be pasted or dragged into the current document

Note - Items are only collected if the Clipboard Window is visible.
To set the Clipboard Window visible, on the view menu, select Clipboard Window


Output Window

The output window displays additional information after running an external application set up in the tools configuration.

Note - When running a tool, and if set up to capture the output the current text will be replaced with a new capture.

Tips
  • If a numeric value is double clicked the active document will try to jump to the same line number.
  • A context menu is available (through right click) which displays more options with the Output Window.
    • Copy - Copy's the current selection
    • Copy All- Copy's all text available.
    • Transfer to a new editor window - Create's a new document window with the current text,
    • Clear - Clear's all current text.

&#169; 1998 - 2006 Carthago Software. All rights reserved.


Project Window

The Project Window shows the current project files as they been set up.
Double click on a file to open in the editor.

The Toolbar allows to work with the current project:

New Project | Creates an empty Project file.
Open Project | Opens an existing Project file.
Save Project | saves current opened Project.
Save Project As | saves current opened Project under a new file.
Organize Project | Opens the Project dialog
Close Project | Closes the current opened Project


Search Results Window

The Search Results Window will be activated after a Find in Files command is invoked.
Only files that met the criteria made in the Find in Files dialog will be shown.

Double clicking in an item will open a new document window in the line that the search was found.


Workspace Window

The Workspace Window lists all currently opened documents in twistpad.
To switch between opened documents, click on the desired item and it will be switched.

Two kind of sorting can be archived:
  • Alphabetically
  • By Folder

&#169; 1998 - 2006 Carthago Software. All rights reserved.


General Preferences

Maximize window on open
Allows the window to use it's maximum space in the Twistpad window

Create New Document at startup
If checked, a new empty document will be created when starting Twistpad

Allow Multiple instances
If checked, Twistpad can be opened with several instances, if not the Twistpad window will be reused
Please note this requires a restart in order to take effect

Close all opened files when loading from workspace
If checked, When Loading a workspace file, all opened documents will be closed.

Use High Color Icons
If Checked, Twistpad will use icons for images with 32 bit resolution, this requires at least a graphics card with 16 million colors

Smooth Progress Bars
If Checked, the style of progress bars will be a smooth block instead of several blocks


Font Preferences

This Screen allows you to change the fonts for the Twistpad application
Please note, that Proporcional Fonts are displayed in bold.


Printer Preferences

Show Line Numbers
if checked, the line numbers will be printed

Wordwrap if checked, the text will be wrapped at continue on the next line. Please note that, if the WordWrap option is not selected, long lines will be cut and will not be printed

Header and Footer
In this two text boxes, the header and the footer can be customized.
special characters can be used.

Special Char | Description
{n} | Document Name and path ex: c:\mypath\myfile
{d} | Document Name only ex: myfile
{p} | Current page number
{a} | Current date
{t} | Current time

Margins
Use this section to determine the margins on the printed page


Tools Preferences

Tools allows you to directly to rapidly open the current document in another file.
This can be another text editor, a compiler or a special porpoise editor.
Description
The description used on the Tools Menu

Application
The path to the external application used to launch the current document

Parameters
Parameters to including when launching the external application

Special Char | Description
{filename} | Current document filename with path
{Single Filename} | Current document filename without the path
{path} | Current document path (folder name only)
{ask} | Twistpad will ask for the Parameters will be when launching the external application
{selection} | Current document text selection will be used as parameters
{Word At Caret} | Current document word where the caret is will be used as parameter


Files Preferences

Open file using directory of currently active document
If checked, the folder of the current document will be used as default when opening a new file

Clean obsolete history files at start up
If checked, non-existing files will be deleted from the history of recently opened files, projects and workspaces.

Create Backup File
If checked, before saving a document, Twistpad will create a file with the contents prior to saving the file using the selected method (BAK extension or adding a ~ before the extension)

Detect when file is changed outside Twistpad
If Checked, Twistpad will warn if a opened file has been changed outside Twistpad and will prompt for reload. (Please note that reloading a file may cause lost of information)

Remember last new file syntax
If checked, Twistpad will remember what was the last syntax selected and automatically apply it when crating a new document.


Filter Preferences

This screen allows the customization of the filters used in Twistpad open file dialog box's.


Syntax Preferences

All registered syntax's are listed here. To edit a file, double click the one you wish and it will be opened in Twistpad.
Refer to the syntax highlighting documentation for more information on how to edit Syntax Files.


Compare Preferences

Ignore Case
If checked, the file compare engine will ignore case diferences in the compared files.

Ignore Blanks
If checked, blank lines will not be flagged as modified

Show Syntax Highlighting
If Checked, files with associated syntax Highlighting will be highlighted.

Ignore foreground colors
If Checked, and syntax highlighting is active, the selected foreground color will not be used. Instead the default syntax highlighting will be used.

Colors
Allows choosing the colors for added, modified or deleted lines.


Auto Recover Preferences

Auto recover allows opened documents to be recovered in the unlikely event of either a Twistpad crash or an operating system crash.
The interval can be customized to suit your needs, keep in mind that whenever saving the files, Twistpad can slow down.


Editor Preferences

Left margin
The numeric input defines the editor left margin, used for text selection.

Tab Stops
The numeric input the number of characters a tab stop represents.

Delimiters
Define the characters considered to be word separators

Auto Back Indent
if checked, pressing BackSpace while no text is selected and the caret is at the left of the first non blank character of the line will make it take the same indentation level as the previous line.

Auto Indent on new line
If checked, pressing Enter will make the new line start at the same indentation level as the previous one. If not, Enter behaves normally and the new line starts at the left.

Smart Brackets
If checked, when applying a bracket, the opposite bracket will be automatically inserted

Smooth Scrolling
If checked, when scrolling text, it will display a smooth movement.

Full Line Select
This option is used to control how the Twistpad draws selected lines when they are completely part of the selection. When not checked, selected lines are highlighted up to their right end. When checked, they are highlighted up to the right edge of the control's window.

Use spaces instead of tab
If checked, spaces will be used instead of the tab character

Indent using Spaces
If checked, when using the indent feature of Twistpad spaces will be used instead of tabs.

Track Changes
This option allows you to see the modified lines in the current document. Yellow margin indicates that the edited line is not yet saved; Green margin indicates that the line was edited before the last save.
Please keep in mind that the colors can be changed

Code Outline
This option allows you enable or disable code outlining

Force Wordwrap
If checked, all new opened files will default to wordwrap view


Editor Display Preferences

Highlight Internet Links
If checked, Internet and e-mail Address's will be highlighted.

Active Internet Links
When Checked, pressing the CTRL key while the mouse cursor is over a internet or e-mail address, will cause it to be highlighted and can be clicked to launch the default web browser or e-mail client

Highlight Current Line
If checked, the current line will be highlighted using a pale color. Please note this color can be changed.

Highlight Brackets
If checked, when the cursor is over a bracket the matching bracket will be highlighted

Show Gutter
If checked, the gutter at the right of the editor is shown

Show Line Numbers
If checked, the corresponding line number will be shown in the gutter

Show Ruler
If checked, a horizontal ruler will be shown on the top of the Twistpad editor

Show Right Line
If checked, a right line will be shown in the editor. This line is useful for documents that require a fixed width

Right Line Position
This numeric value determines where to show the right line

Wrap at Right Line
If checked, when in wordwrap mode, the editor will wrap the text at the right line position. If not, text will be wrapped at the end of the editor width

Show end of File Line
If checked, a horizontal line will flag the end of the file

Enable virtual spaces
If checked, spaces are inserted between the end of the line and the insertion point before new characters are added to the line. When you clear the option, the insertion point is set to the end of the line

Show Hidden Chars
This option let the editor show non visible chars, a small line for tabs, a small point for spaces and a paragraph char for end of paragraphs


Colors Preferences

You can customize the editor related colors in this section.


Auto Complete Preferences

Pressing CTRL-Space in the editor window will pop-up the Auto complete list box.
This allows the quick retrieve of reserved words (of the current syntax), files and folders in the same folder as the current document, and backwards words already used in the current document.
This section allows you to customize which procedures will be used and how many backwards lines will be scanned.


Auto Correct Preferences

If enabled, Auto Correct will replace words for words or sentences.


Snippets

Introduction

Snippets are reusable blocks of code always available at your fingertips. Anything can be used as code snippet, like programs skeletons, frequent address's, javascript samples and so much more.

Usage

To use Snippets in Twistpad press CTRL-J (Please note the shortcut can easily changed to suit your needs) anywhere in the code editor and a listbox similar to auto complete pop's up. All you have to do is choose which is the snippet to use using the mouse or the keyboard and the snippet is instantly inserted at the cursor location.

Configuration

Snippets are text files which are stored in the Snippets folder under the twistpad main folder with the "TSF" extension. To create a new snippet simple save the new created file into the twistpad dir\snippets folder. It will be available the next time you press the "Insert Snippet" shortcut

If a syntax file have a Snippet defined in the header (or several separated by the | symbol) Twistpad will only use the snippets declared in the header.
In the [::Header::] section of a syntax file, the entry Snippet can be used to contain one or more snippet filenames
example:

snippet=A Sample.tsf

or several

Snippet=snippet1.tsf|snippet2.tsf|snippet3.tsf

File description

The Snippets file's are plain text files, so if you need to create a new one, or edit a existing one, simply open it in Twistpad! (a Special Syntax file is supplied for easier editing of snippets)

Sample Snippet file:
Snippet Title

T=Simple Snippet
This is a sample snippet

T=Snippet with hotspot
the cursor will be inserted between here ^\ and here

T=Snippet with several lines
Several Lines can
be added
and the formatting
will be preserved in the Twistpad editor
In the first line is where the Snippet title is, this will be used to identify a snippet file.
Each Snippet is defined by a starting T= with a sample title text.
Every line after the title will be interpreted as a the Snippet text until it finds another Snippet header or the end of file.

The hotspot can be used in two ways, if a snippets has the following symbols ^\ it means that the cursos will move to that place when inserted in Twistpad editor or, if text is selected, it will be used instead of the symbol ^\ A Snippet can omit this symbol.

Please note the space between snippets is not required and is just used to make the sample easier to read


Regular Expressions

Introduction

Regular Expressions are a widely-used method of specifying patterns of text to search for. Special metacharacters allow You to specify, for instance, that a particular string You are looking for occurs at the beginning or end of a line, or contains n recurrences of a certain character.

Simple matches

Any single character matches itself, unless it is a metacharacter with a special meaning described below.
A series of characters matches that series of characters in the target string, so the pattern "bluh" would match "bluh'' in the target string.
You can cause characters that normally function as metacharacters or escape sequences to be interpreted literally by 'escaping' them by preceding them with a backslash "\", for instance: metacharacter "^" match beginning of string, but "\^" match character "^", "\\" match "\" and so on.

Examples:
  foobar          match's string 'foobar'
   \^FooBarPtr     match's '^FooBarPtr'

Escape sequences

Characters may be specified using a escape sequences syntax much like that used in C and Perl: "\n'' matches a newline, "\t'' a tab, etc. More generally, \xnn, where nn is a string of hexadecimal digits, matches the character whose ASCII value is nn. If You need wide (Unicode) character code, You can use '\x{nnnn}', where 'nnnn' - one or more hexadecimal digits.

  \xnn     char with hex code nn
   \x{nnnn} char with hex code nnnn (one byte for plain text and two bytes for Unicode)
   \t       tab (HT/TAB), same as \x09
   \n       newline (NL), same as \x0a
   \r       car.return (CR), same as \x0d
   \f       form feed (FF), same as \x0c
   \a       alarm (bell) (BEL), same as \x07
   \e       escape (ESC), same as \x1b

 Examples:
  foo\x20bar   match's 'foo bar' (note space in the middle)
   \tfoobar     matchs 'foobar' predefined by tab

Character classes

You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list.

If the first character after the "['' is "^'', the class matches any character not in the list.

Examples:
  foob[aeiou]r   finds strings 'foobar', 'foober' etc. but not 'foobbr', 'foobcr' etc.
   foob[^aeiou]r  find strings 'foobbr', 'foobcr' etc. but not 'foobar', 'foober' etc.

Within a list, the "-'' character is used to specify a range, so that a-z represents all characters between "a'' and "z'', inclusive.

If You want "-'' itself to be a member of a class, put it at the start or end of the list, or escape it with a backslash. If You want ']' you may place it at the start of list or escape it with a backslash.

Examples:
  [-az]      match's 'a', 'z' and '-'
   [az-]      match's 'a', 'z' and '-'
   [a\-z]     match's 'a', 'z' and '-'
   [a-z]      match's all twenty six small characters from 'a' to 'z'
   [\n-\x0D]  match's any of #10,#11,#12,#13.
   [\d-t]     match's any digit, '-' or 't'.
   []-a]      match's any char from ']'..'a'.

Metacharacters

Metacharacters are special characters which are the essence of Regular Expressions. There are different types of metacharacters, described below.

Metacharacters - line separators

  ^      start of line
   $      end of line
   \A     start of text
   \Z     end of text
   .      any character in line
Examples:
  ^foobar     match's string 'foobar' only if it's at the beginning of line
   foobar$     match's string 'foobar' only if it's at the end of line
   ^foobar$    match's string 'foobar' only if it's the only string in line
   foob.r      match's strings like 'foobar', 'foobbr', 'foob1r' and so on

Metacharacters - predefined classes

  \w     an alphanumeric character (including "_")
   \W     a nonalphanumeric
   \d     a numeric character
   \D     a non-numeric
   \s     any space (same as [ \t\n\r\f])
   \S     a non space

You may use \w, \d and \s within custom character classes.

Examples:
  foob\dr     match's strings like 'foob1r', ''foob6r' and so on but not 'foobar', 'foobbr' and so on
   foob[\w\s]r match's strings like 'foobar', 'foob r', 'foobbr' and so on but not 'foob1r', 'foob=r' and so on

Metacharacters - word boundaries

  \b     Match a word boundary
   \B     Match a non-(word boundary)
A word boundary (\b) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a \W.

Metacharacters - iterators

Any item of a regular expression may be followed by another type of metacharacters - iterators. Using this metacharacters You can specify number of occurrences of previous character, metacharacter or sub expression.

  *      zero or more ("greedy"), similar to {0,}
  +      one or more ("greedy"), similar to {1,}
  ?      zero or one ("greedy"), similar to {0,1}
  {n}    exactly n times ("greedy")
   {n,}   at least n times ("greedy")
   {n,m}  at least n but not more than m times ("greedy")
   *?     zero or more ("non-greedy"), similar to {0,}?
  +?     one or more ("non-greedy"), similar to {1,}?
  ??     zero or one ("non-greedy"), similar to {0,1}?
  {n}?   exactly n times ("non-greedy")
   {n,}?  at least n times ("non-greedy")
   {n,m}? at least n but not more than m times ("non-greedy")

 So, digits in curly brackets of the form {n,m}, specify the minimum number of times to match the item n and the maximum m. The form {n} is equivalent to {n,n} and matches exactly n times. The form {n,} matches n or more times. There is no limit to the size of n or m, but large numbers will chew up more memory and slow down r.e. execution.

If a curly bracket occurs in any other context, it is treated as a regular character.

Examples:
  foob.*r     match's strings like 'foobar', 'foobalkjdflkj9r' and 'foobr'
   foob.+r     match's strings like 'foobar', 'foobalkjdflkj9r' but not 'foobr'
   foob.?r     match's strings like 'foobar', 'foobbr' and 'foobr' but not 'foobalkj9r'
   fooba{2}r   match's the string 'foobaar'
   fooba{2,}r  matchs strings like 'foobaar', 'foobaaar', 'foobaaaar' etc.
   fooba{2,3}r match's strings like 'foobaar', or 'foobaaar' but not 'foobaaaar'

 A little explanation about "greediness". "Greedy" takes as many as possible, "non-greedy" takes as few as possible. For example, 'b+' and 'b*' applied to string 'abbbbc' return 'bbbb', 'b+?' returns 'b', 'b*?' returns empty string, 'b{2,3}?' returns 'bb', 'b{2,3}' returns 'bbb'.

Metacharacters - alternatives

You can specify a series of alternatives for a pattern using "|'' to separate them, so that fee|fie|foe will match any of "fee'', "fie'', or "foe'' in the target string (as would f(e|i|o)e). The first alternative includes everything from the last pattern delimiter ("('', "['', or the beginning of the pattern) up to the first "|'', and the last alternative contains everything from the last "|'' to the next pattern delimiter. For this reason, it's common practice to include alternatives in parentheses, to minimize confusion about where they start and end.
Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foo|foot against "barefoot'', only the "foo'' part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.)
Also remember that "|'' is interpreted as a literal within square brackets, so if You write [fee|fie|foe] You're really only matching [feio|].

Examples:
  foo(bar|foo)  match's strings 'foobar' or 'foofoo'.

Metacharacters - sub expressions

The bracketing construct ( ... ) may also be used for define r.e. sub expressions.
Sub expressions are numbered based on the left to right order of their opening parenthesis.
First sub expression has number '1'

Examples:
  (foobar){8,10}  match's strings which contain 8, 9 or 10 instances of the 'foobar'
   foob([0-9]|a+)r match's 'foob0r', 'foob1r' , 'foobar', 'foobaar', 'foobaar' etc.

Metacharacters - backreferences

Metacharacters \1 through \9 are interpreted as backreferences. \<n> matches previously matched sub expression #<n>.

Examples:
  (.)\1+         match's 'aaaa' and 'cc'.
   (.+)\1+        also match 'abab' and '123123'
   (['"]?)(\d+)\1 match's '"13" (in double quotes), or '4' (in single quotes) or 77 (without quotes) etc

Perl extensions

You may use it into r.e. for modifying modifiers by the fly. If this construction inlined into sub expression, then it effects only into this sub expression

Examples:
  (?i)Saint-Petersburg       match's 'Saint-petersburg' and 'Saint-Petersburg'
   (?i)Saint-(?-i)Petersburg  match's 'Saint-Petersburg' but not 'Saint-petersburg'
   (?i)(Saint-)?Petersburg    match's 'Saint-petersburg' and 'saint-petersburg'
   ((?i)Saint-)?Petersburg    match's 'saint-Petersburg', but not 'saint-petersburg'


Keyboard Macros

Twistpad has special macros, called Keyboard Macros.
Keyboard macros will allow the recording of repetitive keyboard tasks, and later play back a specified number of times.

Usage

After press Record from the Tools \ Keyboard Macros menu, the mouse cursor will change to contain a tape. press the keys you would like to become recorded in the macro, and then stop the recording by clicking again on the recording button. Twistpad will prompt for the name of the macro. If you cancel at this time, the macro will not be saved, Enter the new macro name and press OK.

To playback, again select in Playback in Tools \ Keyboard Macros menu. Select the macro you wish to use specifying how many times you would like to repeat the macro. press OK.

File Details

Macro Files are stored in the \Macros folders under the Twistpad Folder.
This files should not be edited, but can be deleted in order to delete one or more macros.


Syntax Highlight

Syntax Highlighting in Twistpad is archived via configuration files with the .sdf extension located in the \syntax subfolder of the Twistpad install dir.
please refer to syntax definition files topic for information on how to create and edit new syntax definitions.


Sdf File Definition

Introduction

The syntax file (SDF) is the heart of syntax specific capabilities of Twistpad.
All SDF files are located in the sub-folder "Syntax" of the main Twistpad folder.
It's the SDF files which define how a syntax is applied to a particular file (identified by it's extension)

The syntax of the SDF file is very similar to a standard Windows INI file. If you are familiar with this type of file, it should be easier to edit SDF files.
Although a very complex file syntax can be archived in Twistpad, the ease of creation of a new syntax it's one of the many strengths you can find in Twistpad. In 2 minutes you can create a new syntax file, simply based on keywords.
There are 3 main blocks in a SDF file, the [::Header::] which can be only one, and is not optional, and several sets of optional keywords and start-stop sections.

Header section

The header section is required to proper enable syntax for a specific file type in Twistpad.
the header, as in Ini Files is always : [::Header::]
The keywords for the Header section are:
  • SyntaxName*: The name of the syntax
  • Extensions*: The file extensions where this syntax is applied
  • Functions: Regular expression to define functions or sections
  • HelpFile: One or more Help files for use with this syntax (multiple can be used with the | sign)
  • Spelling: 1 or 0. When 0, means spell nothing, except in the contexts defined in the SpellingContexts keyword, if 1 spell everything except in the contexts defined in the SpellingContexts keyword**
  • SpellingContexts: coma delimited contexts, it's use is defined in the Spelling keyword
  • SnippetFile: Snippet file to use in the syntax
  • Delimiters: custom delimiters for this syntax (please note a space is always considered a delimiter)

Sections

There are two types of sections, Start-Stop Sections and Keywords Section.
Start-Stop Sections define a text color/format for, as the name implies, a block of text with recognized tokens. for instance you could say you want everything that starts with { and ends with } in blue.
Keywords define a single word which is to be colored, for instance, you might want that the word "Blue" appears in blue.
Both have the following Keywords:
  • Type*: StartStop or Keyword
  • Context*: a unique number that identifies this StartStop ID
  • Scope*: Defines a context where this context is active
  • Priority*: or importance of this keyword/StartStop, higher numbers means higher priority in displaying the context
  • WholeWordOnly*: 1 or 0, if 1 the word separator has to be one of the delimiters, if not the word separators are ignored
  • CaseSensitive:1 or 0, Denotes if the StartStop Keys or the Keywords should be treated as case sensitive (1) or not (0)
  • BeginParagraph:1 or 0, Denotes if the StartStop Keys or the Keywords should be only activated if they are the first word in a paragraph
  • StartOfParagraph:1 or 0, Denotes if the StartStop Keys or the Keywords should be only activated if they start at the beginning of a paragraph
  • Background*:Color of the background, in HEX style (use insert color) or Default for default background color
  • Foreground*:Color of the foreground, in HEX style (use insert color) or Default for default foreground color
  • Bold:0 or 1, to make words in bold
  • Italic:0 or 1, to make words in italic

Specific StartStop Keywords

  • First: The first word to define the start section
  • Last: The last word to define the stop section
  • Outline: 0 or 1, defines whether this section can be closed
  • Smart: 0 or 1, defines if the stop section is incremented, for example to find a matching pair of { when smart is enabled, any closing sections are ignored if more open sections are found

Specific Keywords Keywords

  • Keyword1 to Keyword16:here the Keywords are defined with a ; separating each one you can use.

Example

As a simple example let's say that you wish to have the words Twistpad, Syntax and File in blue.
Also everything from { to } in bold red, and everything inside the brackets you wish that the word Color be displayed in green.
Point to new file in Twistpad, create the header that should be something like:

[::Header::]
SyntaxName=Test syntax
extensions=tst

Now, as a rule, although this is not required, you should declare the start stop sections first. So we need to declare the brackets section

[Brackets]
Type=StartStop
Context=1
Scope=0
Priority=7
First={
Last=}
Background=Default
Foreground=FF0000
Bold=1

Now on to the keywords

[BlueKeywords] Type=keyword
Context=100
Scope=0
Priority=6 WholeWordOnly=1
Keyword1=Twistpad;Syntax;File
Background=Default
Foreground=0000FF

[GreenColorOnBrackets] Type=keyword
Context=101
Scope=1
Priority=6 WholeWordOnly=1
Keyword1=Color
Background=Default
Foreground=008000

Notice the scope set to 1, this is to force the use of this style on the context 1, which is the brackets

Tips

The best way to make a new syntax is to modify an existing one, you can find all syntax definition files in the sub folder "Syntax" of Twistpad main folder.
In the Carthago Software Site, you may find a lot of syntax files, the chances are you will not need to create any SDF file, as someone might already created it!

Notes

* Denotes a required keyword
** Context's are explained in the StartStop and Keywords section


Templates

Introduction

Twistpad supports simple document templates.
A Document template is pre-prepared document for common tasks. Ie. you might want to have a body template of your web-page, or a common file in computer programming tasks.

Usage

To create a new document based on an existing template, select New from the File Menu, and select the templates folder in the tree at the left. The available templates will be displayed in a list on the right, select the one you wish and press 'OK'

Configuration

Templates reside in the folder "Templates" under the Twistpad main folder. To delete an existing template, simply open the folder in Windows Explorer and delete the specified file. To edit an existing template, open it with Twistpad, make the modifications and save the file. When Creating a new template, make sure you save it in the Twistpad Dir \Templates folder. It will be available for selection when pressing New of the File Menu


File Compare

Introduction

Usage

© 1998 - 2006 Carthago Software. All rights reserved.


Search Results Window

Twistpad uses the MDI (multiple document interface) concept.
This allows several documents to be opened at the same time which can be switched to easily with the switch bar: